package middleware

import (
	"net/http"
)

type UserMiddleware struct {
}

func NewUserMiddleware() *UserMiddleware {
	return &UserMiddleware{}
}

func (m *UserMiddleware) Handle(next http.HandlerFunc) http.HandlerFunc {
	return func(w http.ResponseWriter, r *http.Request) {
		// 防止xss攻击
		w.Header().Set("X-XSS-Protection", "1; mode=block")
		next(w, r)
	}
}
